package com.mt.mall.service.good;

import com.mt.common.core.web.base.PageDTO;
import com.mt.common.core.web.base.PageResultDTO;
import com.mt.mall.entity.good.SpecificationStock;

import java.util.List;

public interface SpecificationStockService {
    /**
     * 根据分页参数查询商品销售规格集合
     *
     * @param pageDTO 分页条件
     */
    public PageResultDTO findSpecificationStocks(PageDTO pageDTO);

    /**
     * 查询全部商品销售规格集合
     *
     */
    public List<SpecificationStock> findAllSpecificationStocks();

    /**
     * 根据名称查询商品销售规格集合(只提取ID 和 Name)
     *
     * @param specificationStockName 名称
     */
    public List<SpecificationStock> findSpecificationStocksWithIdNameByName(String specificationStockName);

    /**
     * 查询所有商品销售规格集合(只提取ID 和 Name)
     *
     */
    public List<SpecificationStock> findAllSpecificationStocksWithIdName();

    /**
     * 根据ID查询指定的商品销售规格(只提取ID 和 Name)
     *
     * @param specificationStockId Id
     */
    public SpecificationStock findSpecificationStocksWithIdNameById(Long specificationStockId);

    /**
     * 根据ID查询指定的商品销售规格
     *
     * @param specificationStockId Id
     */
    public SpecificationStock findSpecificationStock(Long specificationStockId);

    /**
     * 根据ID查询指定的商品销售规格(包含外键)
     *
     * @param specificationStockId Id
     */
    public SpecificationStock findSpecificationStockWithForeignName(Long specificationStockId);

    /**
     * 新增商品销售规格
     *
     * @param specificationStock 实体对象
     */
    public SpecificationStock saveSpecificationStock(SpecificationStock specificationStock);

    /**
     * 更新商品销售规格
     *
     * @param specificationStock 实体对象
     */
    public SpecificationStock updateSpecificationStock(SpecificationStock specificationStock);

    /**
     * 根据ID删除商品销售规格
     *
     * @param specificationStockId ID
     */
    public void deleteSpecificationStock(Long specificationStockId);

    List<SpecificationStock> findSpecificationStockByCommodityId(Long commodityId);

    Long decrStock(Long commodityId, String specification, Integer count);

    Integer getStock(Long commodityId, String specification);

    int incrStock(Long commodityId, String specification, Integer count);
}
